<template>
	<view>
		<view class="content" :class="get_bg_url">
			<slot name='icon'></slot>
			<slot name="name"></slot>
			<slot name="id"></slot>
			<!-- <text>{{item.name}}</text>
			<text>{{item.id}}</text> -->
		</view>
	</view>
</template>


<script>
	export default {
		name: "location",
		props: {
			bg_url: {
				type: [Number, String],
				default: 0
			},
		},
		data() {
			return {

			};
		},
		computed: {
			get_bg_url() {
				if (this.bg_url == 0) {
					return 'floor-url'
				} else if (this.bg_url == 1) {
					return 'unit-url'

				} else if (this.bg_url == 2) {
					return 'room-url'

				}
			}
		}
	}
</script>

<style lang="scss">
	.floor-url {
		background-image: url('../../static/icon/ld@2x.png');
	}
	
	.unit-url {
		background-image: url('../../static/icon/dy@2x.png');
	}
	
	.room-url {
		background-image: url('../../static/icon/fw@2x.png');
	}
	
	.content {
		border-top: 1px solid #F0F0F0;
		padding: 20rpx 0;
		font-size: $uni-font-size-base;
		background-repeat: no-repeat;
		background-size: 26rpx;
		background-position-y: center;

		text {
			margin-left: 36rpx;
		}
	}
</style>
